package cn.signalpha.modules.com.entity.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 类说明
 *
 * @author signalpha
 */
@Getter
@AllArgsConstructor
public enum WalletSourceEnum {

	/**
	 * 邀请新用户注册
	 */
	INVITE("invite","邀请新用户{}"),

	/**
	 * 商品购买
	 */
	GOODS("goods","购买{}"),

	/**
	 * 订单结算
	 */
	ORDER_SETTLE("orderSettle", "订单结算"),

	/**
	 * 订单退款
	 */
	ORDER_REFUND("orderRefund", "订单退款"),

	/**
	 * 商品购买 一级佣金
	 */
	DIRECT("direct", "直推奖励"),

	/**
	 * 商品购买 二级佣金
	 */
	INDIRECT("indirect", "间推奖励"),

	/**
	 * 签到
	 */
	SIGN_IN("signIn", "签到"),

	/**
	 * 提现申请
	 */
	WITHDRAW_APPLY("withdrawApply","提现申请"),

	/**
	 * 提现驳回
	 */
	WITHDRAW_REJECT("withdrawReject","提现驳回"),

	/**
	 * 系统发放
	 */
	SYSTEM("system","系统发放"),
    ;

    private final String type;
    private final String name;

	public static WalletSourceEnum instance(String type) {
		WalletSourceEnum[] values = WalletSourceEnum.values();
		for (WalletSourceEnum statusEnum : values) {
			if (statusEnum.type.equals(type)) {
				return statusEnum;
			}
		}
		return null;
	}

}
